package refactor.encapsulatecollection;

import static org.assertj.core.api.Assertions.assertThat;

public class Client {
    public void clientMethod() {
        Person dayna = new Person();
        dayna.addCourse(new Course("Math", true));
        dayna.addCourse(new Course("English", false));
        assertThat(dayna.getCourseCount()).isEqualTo(2);
        Course chinese = new Course("Chinese", true);
        dayna.addCourse(chinese);
        dayna.addCourse(new Course("Java", true));
        assertThat(dayna.getCourseCount()).isEqualTo(4);
        dayna.removeCourse(chinese);
        assertThat(dayna.getCourseCount()).isEqualTo(3);
        int count = dayna.getAdvancedCourseCount();
        assertThat(count).isEqualTo(2);
        //dayna.getCourses().add(new Course("JS",false));
    }

    public static void main(String[] args) {
        new Client().clientMethod();
    }
}
